package com.demo.resourcecode.c6;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class LifecycleDemo {

	public static void main(String[] args) {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("lifecycle.xml");
		// 当注册了JVM钩子后，即可以实现优雅关闭
		context.registerShutdownHook();
	}

}
